import type { FileSystemItem } from "../types/fileSystem";

// 模拟文件系统数据
export const fileSystemData: Record<string, FileSystemItem[]> = {
  "/": [
    {
      name: "本地磁盘 (C:)",
      type: "folder",
      lastModified: new Date(),
      children: [],
    },
    {
      name: "本地磁盘 (D:)",
      type: "folder",
      lastModified: new Date(),
      children: [],
    },
  ],
  "/C:": [
    {
      name: "Users",
      type: "folder",
      lastModified: new Date("2024-01-15"),
      children: [],
    },
    {
      name: "Windows",
      type: "folder",
      lastModified: new Date("2024-01-10"),
      children: [],
    },
    {
      name: "Program Files",
      type: "folder",
      lastModified: new Date("2024-01-12"),
      children: [],
    },
    {
      name: "Program Files (x86)",
      type: "folder",
      lastModified: new Date("2024-01-12"),
      children: [],
    },
    {
      name: "ProgramData",
      type: "folder",
      lastModified: new Date("2024-01-08"),
      children: [],
    },
    {
      name: "Temp",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
    {
      name: "Intel",
      type: "folder",
      lastModified: new Date("2023-12-15"),
      children: [],
    },
    {
      name: "bootmgr",
      type: "file",
      size: 614400,
      extension: "sys",
      lastModified: new Date("2023-11-14"),
    },
    {
      name: "pagefile.sys",
      type: "file",
      size: 17179869184, // 16GB
      extension: "sys",
      lastModified: new Date("2024-01-21"),
    },
  ],
  "/C:/Users": [
    {
      name: "Administrator",
      type: "folder",
      lastModified: new Date("2024-01-20"),
      children: [],
    },
    {
      name: "Public",
      type: "folder",
      lastModified: new Date("2024-01-10"),
      children: [],
    },
    {
      name: "Default",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "DefaultAppPool",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],
  "/C:/Users/Administrator": [
    {
      name: "Desktop",
      type: "folder",
      lastModified: new Date("2024-01-20"),
      children: [],
    },
    {
      name: "Documents",
      type: "folder",
      lastModified: new Date("2024-01-19"),
      children: [],
    },
    {
      name: "Downloads",
      type: "folder",
      lastModified: new Date("2024-01-20"),
      children: [],
    },
    {
      name: "Pictures",
      type: "folder",
      lastModified: new Date("2024-01-18"),
      children: [],
    },
    {
      name: "Music",
      type: "folder",
      lastModified: new Date("2024-01-17"),
      children: [],
    },
    {
      name: "Videos",
      type: "folder",
      lastModified: new Date("2024-01-16"),
      children: [],
    },
    {
      name: "Favorites",
      type: "folder",
      lastModified: new Date("2024-01-10"),
      children: [],
    },
    {
      name: "Links",
      type: "folder",
      lastModified: new Date("2024-01-10"),
      children: [],
    },
    {
      name: "Saved Games",
      type: "folder",
      lastModified: new Date("2024-01-05"),
      children: [],
    },
    {
      name: "Searches",
      type: "folder",
      lastModified: new Date("2023-12-15"),
      children: [],
    },
    {
      name: "Contacts",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "3D Objects",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "OneDrive",
      type: "folder",
      lastModified: new Date("2024-01-20"),
      children: [],
    },
    {
      name: "AppData",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
    {
      name: "NTUSER.DAT",
      type: "file",
      size: 16777216,
      extension: "dat",
      lastModified: new Date("2024-01-21"),
    },
    {
      name: "ntuser.dat.LOG1",
      type: "file",
      size: 1048576,
      extension: "log1",
      lastModified: new Date("2024-01-21"),
    },
  ],
  "/C:/Users/Administrator/Desktop": [
    {
      name: "我的项目.lnk",
      type: "file",
      size: 1024,
      extension: "lnk",
      lastModified: new Date("2024-01-20"),
    },
    {
      name: "Chrome.lnk",
      type: "file",
      size: 2048,
      extension: "lnk",
      lastModified: new Date("2024-01-15"),
    },
    {
      name: "Visual Studio Code.lnk",
      type: "file",
      size: 1536,
      extension: "lnk",
      lastModified: new Date("2024-01-18"),
    },
    {
      name: "Steam.lnk",
      type: "file",
      size: 2048,
      extension: "lnk",
      lastModified: new Date("2023-12-25"),
    },
    {
      name: "Photoshop 2024.lnk",
      type: "file",
      size: 1792,
      extension: "lnk",
      lastModified: new Date("2023-12-10"),
    },
    {
      name: "Microsoft Office.lnk",
      type: "file",
      size: 1280,
      extension: "lnk",
      lastModified: new Date("2023-12-20"),
    },
    {
      name: "工作文档",
      type: "folder",
      lastModified: new Date("2024-01-19"),
      children: [],
    },
    {
      name: "项目截图",
      type: "folder",
      lastModified: new Date("2024-01-18"),
      children: [],
    },
    {
      name: "临时文件",
      type: "folder",
      lastModified: new Date("2024-01-20"),
      children: [],
    },
    {
      name: "备忘录.txt",
      type: "file",
      size: 4096,
      extension: "txt",
      lastModified: new Date("2024-01-21"),
    },
    {
      name: "桌面背景.jpg",
      type: "file",
      size: 2097152,
      extension: "jpg",
      lastModified: new Date("2024-01-15"),
    },
    {
      name: "大文件列表测试",
      type: "folder",
      lastModified: new Date("2024-01-22"),
      children: [],
    },
    {
      name: "超大文件列表测试",
      type: "folder",
      lastModified: new Date("2024-01-22"),
      children: [],
    },
    {
      name: "空文件夹测试",
      type: "folder",
      lastModified: new Date("2024-01-22"),
      children: [],
    },
  ],

  // Public用户目录
  "/C:/Users/Public": [
    {
      name: "Public Desktop",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Public Documents",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Public Downloads",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Public Music",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Public Pictures",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Public Videos",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],

  // Default用户模板目录
  "/C:/Users/Default": [
    {
      name: "Desktop",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Documents",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Downloads",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "AppData",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "NTUSER.DAT",
      type: "file",
      size: 524288,
      extension: "dat",
      lastModified: new Date("2023-12-01"),
    },
  ],

  // DefaultAppPool用户目录（IIS应用程序池用户）
  "/C:/Users/DefaultAppPool": [
    {
      name: "AppData",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Temporary ASP.NET Files",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],

  "/C:/Users/Administrator/Documents": [
    {
      name: "工作报告.docx",
      type: "file",
      size: 524288,
      extension: "docx",
      lastModified: new Date("2024-01-19"),
    },
    {
      name: "项目计划.xlsx",
      type: "file",
      size: 102400,
      extension: "xlsx",
      lastModified: new Date("2024-01-18"),
    },
    {
      name: "演示文稿.pptx",
      type: "file",
      size: 2097152,
      extension: "pptx",
      lastModified: new Date("2024-01-17"),
    },
    {
      name: "会议记录.txt",
      type: "file",
      size: 8192,
      extension: "txt",
      lastModified: new Date("2024-01-16"),
    },
    {
      name: "财务报表.xlsx",
      type: "file",
      size: 258048,
      extension: "xlsx",
      lastModified: new Date("2024-01-15"),
    },
    {
      name: "合同模板.docx",
      type: "file",
      size: 87040,
      extension: "docx",
      lastModified: new Date("2024-01-10"),
    },
    {
      name: "客户名单.xlsx",
      type: "file",
      size: 45056,
      extension: "xlsx",
      lastModified: new Date("2024-01-08"),
    },
    {
      name: "产品说明书.pdf",
      type: "file",
      size: 1572864,
      extension: "pdf",
      lastModified: new Date("2024-01-05"),
    },
    {
      name: "技术文档",
      type: "folder",
      lastModified: new Date("2024-01-12"),
      children: [],
    },
    {
      name: "培训资料",
      type: "folder",
      lastModified: new Date("2023-12-28"),
      children: [],
    },
    {
      name: "个人简历",
      type: "folder",
      lastModified: new Date("2023-12-15"),
      children: [],
    },
    {
      name: "Adobe PDF",
      type: "folder",
      lastModified: new Date("2023-12-10"),
      children: [],
    },
  ],
  "/C:/Users/Administrator/Downloads": [
    {
      name: "Chrome安装包.exe",
      type: "file",
      size: 67108864,
      extension: "exe",
      lastModified: new Date("2024-01-20"),
    },
    {
      name: "系统更新.msi",
      type: "file",
      size: 134217728,
      extension: "msi",
      lastModified: new Date("2024-01-19"),
    },
    {
      name: "压缩包.zip",
      type: "file",
      size: 16777216,
      extension: "zip",
      lastModified: new Date("2024-01-18"),
    },
    {
      name: "Node.js-v20.10.0-x64.msi",
      type: "file",
      size: 33554432,
      extension: "msi",
      lastModified: new Date("2024-01-08"),
    },
    {
      name: "VSCodeUserSetup-x64-1.85.0.exe",
      type: "file",
      size: 95420416,
      extension: "exe",
      lastModified: new Date("2024-01-18"),
    },
    {
      name: "安装包",
      type: "folder",
      lastModified: new Date("2024-01-10"),
      children: [],
    },
    {
      name: "驱动程序",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],
  "/D:": [
    {
      name: "游戏",
      type: "folder",
      lastModified: new Date("2024-01-15"),
      children: [],
    },
    {
      name: "软件",
      type: "folder",
      lastModified: new Date("2024-01-14"),
      children: [],
    },
    {
      name: "备份",
      type: "folder",
      lastModified: new Date("2024-01-13"),
      children: [],
    },
    {
      name: "开发项目",
      type: "folder",
      lastModified: new Date("2024-01-20"),
      children: [],
    },
    {
      name: "虚拟机",
      type: "folder",
      lastModified: new Date("2024-01-10"),
      children: [],
    },
    {
      name: "电影",
      type: "folder",
      lastModified: new Date("2024-01-08"),
      children: [],
    },
    {
      name: "音乐库",
      type: "folder",
      lastModified: new Date("2024-01-05"),
      children: [],
    },
    {
      name: "设计素材",
      type: "folder",
      lastModified: new Date("2023-12-28"),
      children: [],
    },
    {
      name: "系统镜像",
      type: "folder",
      lastModified: new Date("2023-12-15"),
      children: [],
    },
    {
      name: "Temp",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
  ],
  "/D:/开发项目": [
    {
      name: "Web开发",
      type: "folder",
      lastModified: new Date("2024-01-20"),
      children: [],
    },
    {
      name: "Vue项目",
      type: "folder",
      lastModified: new Date("2024-01-18"),
      children: [],
    },
    {
      name: "React项目",
      type: "folder",
      lastModified: new Date("2024-01-15"),
      children: [],
    },
    {
      name: "Node.js",
      type: "folder",
      lastModified: new Date("2024-01-12"),
      children: [],
    },
    {
      name: "Python",
      type: "folder",
      lastModified: new Date("2024-01-10"),
      children: [],
    },
    {
      name: "README.md",
      type: "file",
      size: 16384,
      extension: "md",
      lastModified: new Date("2024-01-20"),
    },
    {
      name: ".gitignore",
      type: "file",
      size: 2048,
      extension: "gitignore",
      lastModified: new Date("2024-01-18"),
    },
  ],

  // 空目录路径条目
  "/C:/Users/Administrator/Desktop/工作文档": [],
  "/C:/Users/Administrator/Desktop/项目截图": [],
  "/C:/Users/Administrator/Desktop/临时文件": [],

  // 大文件列表测试（用于测试虚拟滚动性能）
  "/C:/Users/Administrator/Desktop/大文件列表测试": [
    // 生成1000个测试文件
    ...Array.from({ length: 1000 }, (_, i) => ({
      name: `测试文件_${String(i + 1).padStart(4, "0")}.${
        [
          "txt",
          "docx",
          "xlsx",
          "pptx",
          "pdf",
          "jpg",
          "png",
          "mp4",
          "mp3",
          "zip",
        ][i % 10]
      }`,
      type: "file" as const,
      size: Math.floor(Math.random() * 10485760) + 1024, // 1KB to 10MB
      extension: [
        "txt",
        "docx",
        "xlsx",
        "pptx",
        "pdf",
        "jpg",
        "png",
        "mp4",
        "mp3",
        "zip",
      ][i % 10],
      lastModified: new Date(
        2024,
        0,
        Math.floor(Math.random() * 31) + 1,
        Math.floor(Math.random() * 24),
        Math.floor(Math.random() * 60)
      ),
    })),
    // 添加50个测试文件夹
    ...Array.from({ length: 50 }, (_, i) => ({
      name: `文件夹_${String(i + 1).padStart(3, "0")}`,
      type: "folder" as const,
      lastModified: new Date(2024, 0, Math.floor(Math.random() * 31) + 1),
      children: [],
    })),
  ],

  // 超大文件列表测试（用于测试虚拟滚动极限性能 - 10000个文件）
  "/C:/Users/Administrator/Desktop/超大文件列表测试": [
    // 生成10000个测试文件
    ...Array.from({ length: 10000 }, (_, i) => ({
      name: `性能测试文件_${String(i + 1).padStart(5, "0")}.${
        [
          "txt",
          "docx",
          "xlsx",
          "pptx",
          "pdf",
          "jpg",
          "png",
          "mp4",
          "mp3",
          "zip",
          "rar",
          "7z",
          "html",
          "css",
          "js",
          "ts",
          "vue",
          "json",
          "xml",
          "sql",
        ][i % 20]
      }`,
      type: "file" as const,
      size: Math.floor(Math.random() * 104857600) + 1024, // 1KB to 100MB
      extension: [
        "txt",
        "docx",
        "xlsx",
        "pptx",
        "pdf",
        "jpg",
        "png",
        "mp4",
        "mp3",
        "zip",
        "rar",
        "7z",
        "html",
        "css",
        "js",
        "ts",
        "vue",
        "json",
        "xml",
        "sql",
      ][i % 20],
      lastModified: new Date(
        2024,
        Math.floor(Math.random() * 12),
        Math.floor(Math.random() * 28) + 1,
        Math.floor(Math.random() * 24),
        Math.floor(Math.random() * 60)
      ),
    })),
    // 添加500个测试文件夹
    ...Array.from({ length: 500 }, (_, i) => ({
      name: `性能测试文件夹_${String(i + 1).padStart(4, "0")}`,
      type: "folder" as const,
      lastModified: new Date(
        2024,
        Math.floor(Math.random() * 12),
        Math.floor(Math.random() * 28) + 1
      ),
      children: [],
    })),
  ],

  // 空文件夹测试
  "/C:/Users/Administrator/Desktop/空文件夹测试": [],

  // Public用户目录的子目录
  "/C:/Users/Public/Public Desktop": [],
  "/C:/Users/Public/Public Documents": [
    {
      name: "示例文档.txt",
      type: "file",
      size: 2048,
      extension: "txt",
      lastModified: new Date("2023-12-01"),
    },
  ],
  "/C:/Users/Public/Public Downloads": [],
  "/C:/Users/Public/Public Music": [],
  "/C:/Users/Public/Public Pictures": [
    {
      name: "示例图片",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],
  "/C:/Users/Public/Public Videos": [],

  // Default用户模板目录的子目录
  "/C:/Users/Default/Desktop": [],
  "/C:/Users/Default/Documents": [],
  "/C:/Users/Default/Downloads": [],
  "/C:/Users/Default/AppData": [
    {
      name: "Local",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Roaming",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],

  // DefaultAppPool用户目录的子目录
  "/C:/Users/DefaultAppPool/AppData": [
    {
      name: "Local",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],
  "/C:/Users/DefaultAppPool/AppData/Local": [
    {
      name: "Temp",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
    {
      name: "Application Data",
      type: "folder",
      lastModified: new Date("2023-12-01"),
      children: [],
    },
  ],
  "/C:/Users/DefaultAppPool/AppData/Local/Temp": [],
  "/C:/Users/DefaultAppPool/Temporary ASP.NET Files": [],

  // Administrator用户目录的子目录
  "/C:/Users/Administrator/Pictures": [],
  "/C:/Users/Administrator/Music": [],
  "/C:/Users/Administrator/Videos": [],
  "/C:/Users/Administrator/Favorites": [],
  "/C:/Users/Administrator/Links": [],
  "/C:/Users/Administrator/Saved Games": [],
  "/C:/Users/Administrator/Searches": [],
  "/C:/Users/Administrator/Contacts": [],
  "/C:/Users/Administrator/3D Objects": [],
  "/C:/Users/Administrator/OneDrive": [],
  "/C:/Users/Administrator/AppData": [
    {
      name: "Local",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
    {
      name: "Roaming",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
    {
      name: "LocalLow",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
  ],

  // Administrator AppData 子目录
  "/C:/Users/Administrator/AppData/Local": [
    {
      name: "Temp",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
    {
      name: "Microsoft",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
    {
      name: "Google",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
  ],
  "/C:/Users/Administrator/AppData/Roaming": [
    {
      name: "Microsoft",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
    {
      name: "Adobe",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
  ],
  "/C:/Users/Administrator/AppData/LocalLow": [
    {
      name: "Microsoft",
      type: "folder",
      lastModified: new Date("2024-01-21"),
      children: [],
    },
  ],

  // Administrator Documents 子目录
  "/C:/Users/Administrator/Documents/技术文档": [],
  "/C:/Users/Administrator/Documents/培训资料": [],
  "/C:/Users/Administrator/Documents/个人简历": [],
  "/C:/Users/Administrator/Documents/Adobe PDF": [],

  // Administrator Downloads 子目录
  "/C:/Users/Administrator/Downloads/安装包": [],
  "/C:/Users/Administrator/Downloads/驱动程序": [],

  // Public 子目录
  "/C:/Users/Public/Public Pictures/示例图片": [],

  // Default AppData 子目录
  "/C:/Users/Default/AppData/Local": [],
  "/C:/Users/Default/AppData/Roaming": [],

  // 动态生成的测试文件夹路径条目 - 大文件列表测试
  ...Array.from({ length: 50 }, (_, i) => {
    const folderName = `文件夹_${String(i + 1).padStart(3, "0")}`;
    return {
      [`/C:/Users/Administrator/Desktop/大文件列表测试/${folderName}`]: [],
    };
  }).reduce((acc, obj) => ({ ...acc, ...obj }), {}),

  // 动态生成的测试文件夹路径条目 - 超大文件列表测试
  ...Array.from({ length: 500 }, (_, i) => {
    const folderName = `性能测试文件夹_${String(i + 1).padStart(4, "0")}`;
    return {
      [`/C:/Users/Administrator/Desktop/超大文件列表测试/${folderName}`]: [],
    };
  }).reduce((acc, obj) => ({ ...acc, ...obj }), {}),

  // D盘开发项目的子目录路径条目
  "/D:/开发项目/Web开发": [],
  "/D:/开发项目/Vue项目": [],
  "/D:/开发项目/React项目": [],
  "/D:/开发项目/Node.js": [],
  "/D:/开发项目/Python": [],
};
